var api = require("../../api.js"), app = getApp();
Page({
  data: {
    info:[],
    url:'',
    name:''
  },
  onLoad: function (options) {
    console.log(options)
    this.setData({
      url: options.url,
      name: options.name
    });
    wx.setNavigationBarTitle({
      title:options.name
    });
    let ts = this;
    let info = [];
    let config_info = [];
    app.request({
      url: api.default.index,
      data: {},
      success: function(t) {
        let res = t.data.module_list_2;
        res.forEach(item=>{
          if(item.module_name === 'images'){
            info = item.content
          }
        });
        info.forEach(item=>{
          if(options.url.indexOf(item.id) >=0 ){
            config_info = config_info.concat(item.content);
          }
        });
        ts.setData({info:config_info})
      },
    });

  },
  onShareAppMessage: function(){
    let share = {
      title:this.data.name,
      path:'/pages/showImg/showImg?url=' + this.data.url + '&name=' + this.data.name
    };
    return share
  },
});
